package com.zc.im.seqsvr.converter;

import com.zc.im.common.constant.enums.BaseEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.convert.converter.Converter;
import org.springframework.core.convert.converter.ConverterRegistry;
import org.springframework.data.convert.ReadingConverter;
import org.springframework.data.convert.WritingConverter;
import org.springframework.data.r2dbc.convert.R2dbcCustomConversions;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

/**
 * Project：im
 * Date：2022-04-20
 * Time：22:14
 * Description：
 *
 * @author ChallenZhang
 * @version 1.0
 */
@WritingConverter
public class BaseEnumToNumberConverter implements Converter<BaseEnum<Number>, Number> {

    @Override
    public Number convert(BaseEnum<Number> source) {
        return source.getValue();
    }
}
